/*
 * @Author: ls
 * @Date: 2021-11-19 13:10:36
 * @LastEditTime: 2021-11-19 13:45:10
 * @LastEditors: ls
 * @Description: 文本输入控制
 * @FilePath: \BezierEditor-master\assets\Script\Input.js
 */

cc.Class({
	extends: cc.Component,

	properties: {},

	onLoad() {
		this.node.on('text-changed', this._change, this); // 注册输入框值改变事件
	},

	_change(event) {
		let key = event.name,
			value = event.string,
			bezier = require('Bezier');

		switch (key) {
			case 'bezierFrame<EditBox>':
				bezier.changeParam('num', value);
				break;
			case 'windowWidth<EditBox>':
				bezier.changeParam('width', value);
				break;
			case 'windowHeight<EditBox>':
				bezier.changeParam('height', value);
				break;
			case 'bezierFrameRate<EditBox>':
				break;
		}
		bezier.repaint();
	},
});
